package hoaitt.vnu.edu.problem5;

import java.util.Arrays;
//import org.apache.commons.lang.ArrayUtils;

public class BCNN {
//	private int x,y;
//	private int i, ucln, bcnn, n;
//	private int a[];
	public static long UCLN(long x, long y) {
		if (y == 0) {
			return x;
		}
		
		return UCLN(y, x%y);
		
	}
	
	
	public static void main(String[] args) {
		int a[] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};
		
		
		// long uc = UCLN(a[0], a[1]);
		//long bc = (a[0] * a[1]) / uc;
		// TrinhNX 03/13: Comment:
		// Bien uc co' can thiet la long ko :3
		long uc, bc = a[0];
		for (int i = 0; i < a.length-1; i++) {
			uc = UCLN(bc, a[i+1]);
			bc = (bc*a[i+1])/uc;
		}
	
		System.out.println("BCNN: "+bc);
	}

}
